package com.asset.salesforce.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import java.util.Set;
@SuppressWarnings("serial")
@Table(name="company")
@Entity
public class Company implements Serializable{
	
	private Integer id;
	
	private String companyName;
	
	private Integer companyCountryId;
	
	private Integer employeesNumber;
	
	private Integer ownerId;
	private Set<Employee> employees;
	

	/**
	 * @return the employees
	 */
	@OneToMany(mappedBy ="company" ,fetch=FetchType.EAGER)
	//@Fetch(fe)
	public Set<Employee> getEmployees() {
		return employees;
	}

	/**
	 * @param employees the employees to set
	 */
	public void setEmployees(Set<Employee> employees) {
		this.employees = employees;
	}

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="company_id_seq")
	@SequenceGenerator(name="company_id_seq",sequenceName="company_id_seq",allocationSize=1)
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the companyName
	 */
	@Column(name="company_name")
	public String getCompanyName() {
		return companyName;
	}

	/**
	 * @param companyName the companyName to set
	 */
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	/**
	 * @return the companyCountryId
	 */
	@Column(name="company_country_id")
	public Integer getCompanyCountryId() {
		return companyCountryId;
	}

	/**
	 * @param companyCountryId the companyCountryId to set
	 */
	public void setCompanyCountryId(Integer companyCountryId) {
		this.companyCountryId = companyCountryId;
	}

	/**
	 * @return the employessNumber
	 */
	@Column(name="employees_number")
	public Integer getEmployeesNumber() {
		return employeesNumber;
	}

	/**
	 * @param employessNumber the employessNumber to set
	 */
	public void setEmployeesNumber(Integer employeesNumber) {
		this.employeesNumber = employeesNumber;
	}

	/**
	 * @return the ownerId
	 */
	@Column(name="owner_id")
	public Integer getOwnerId() {
		return ownerId;
	}

	/**
	 * @param ownerId the ownerId to set
	 */
	public void setOwnerId(Integer ownerId) {
		this.ownerId = ownerId;
	}
	
	
}
